<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>详情</title>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="../../css/oksub.css">
	<script type="text/javascript" src="../../lib/loading/okLoading.js"></script>
</head>
<body>
<div class="ok-body">
	<!--form表单-->
	<form class="layui-form layui-form-pane ok-form">
        <div class="layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label-big">活动时间</label>
				<div class="layui-input-block-big">
					<input type="text" name="time" class="layui-input" disabled>
				</div>
			</div>
			<div class="layui-col-md6">
				<label class="layui-form-label-big">活动名称</label>
				<div class="layui-input-block-big">
					<input type="text" name="name" class="layui-input" disabled>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label-big">活动人数</label>
				<div class="layui-input-block-big">
					<input type="text" name="num" class="layui-input" disabled>
				</div>
			</div>
			<div class="layui-col-md6">
				<label class="layui-form-label-big">活动区域</label>
				<div class="layui-input-block-big">
					<input type="text" name="activity_area_name" class="layui-input" disabled>
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label-big">活动时长</label>
				<div class="layui-input-block-big">
					<input type="text" name="activity_duration" class="layui-input" disabled>
				</div>
			</div>
			<div class="layui-col-md6">
				<label class="layui-form-label-big">举办单位</label>
				<div class="layui-input-block-big">
					<input type="text" name="unit_name" class="layui-input" disabled>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label-big">联系人</label>
				<div class="layui-input-block-big">
					<input type="text" name="contacts" class="layui-input" disabled>
				</div>
			</div>
			<div class="layui-col-md6">
				<label class="layui-form-label-big">联系方式</label>
				<div class="layui-input-block-big">
					<input type="text" name="phone" class="layui-input" disabled>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label-big">预约人</label>
				<div class="layui-input-block-big">
					<input type="text" name="user_name" class="layui-input" disabled>
				</div>
			</div>
			<div class="layui-col-md6">
				<label class="layui-form-label-big">状态</label>
				<div class="layui-input-block-big">
					<input type="text" name="status_name" class="layui-input" disabled>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label-big">是否摆放物品</label>
				<div class="layui-input-block-big">
					<input type="text" name="is_placing_items_name" class="layui-input" disabled>
				</div>
			</div>
			<div class="layui-col-md6">
				<label class="layui-form-label-big">是否直播</label>
				<div class="layui-input-block-big">
					<input type="text" name="is_live_name" class="layui-input" disabled>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label-big">是否录制视频</label>
				<div class="layui-input-block-big">
					<input type="text" name="is_video_recording_name" class="layui-input" disabled>
				</div>
			</div>
			<div class="layui-col-md6">
				<label class="layui-form-label-big">是否公开</label>
				<div class="layui-input-block-big">
					<input type="text" name="is_open_name" class="layui-input" disabled>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block-big">
				<a class="layui-btn layui-btn-primary close">关闭</a>
			</div>
		</div>
	</form>
</div>
<!--js逻辑-->
<script src="../../lib/layui/layui.js"></script>
<script type="text/javascript">
	layui.use(["form", "okLayer", "okUtils", "okMock", "table"], function () {
		let $ = layui.jquery;
		let form = layui.form;
		let okMock = layui.okMock;
        let table = layui.table;
		let okLayer = layui.okLayer;
		let okUtils = layui.okUtils;
		//关闭loading
		okLoading.close();

		//获取url地址中的参数
        var id = okUtils.getUrlParams("id");
		//发送ajax请求获取详情
		okUtils.ajax(okMock.api.reservation_record.activity_detail, "get", {id: id}).done(function (response) {
			if (response.code == HTTP_OK) {
				//将数据填充到表单中
				$('input[name="time"]').val(response.data.time);
				$('input[name="name"]').val(response.data.name);
				$('input[name="num"]').val(response.data.num);
				$('input[name="activity_area_name"]').val(response.data.activity_area_name);
				$('input[name="activity_duration"]').val(response.data.activity_duration);
				$('input[name="unit_name"]').val(response.data.unit_name);
				$('input[name="contacts"]').val(response.data.contacts);
				$('input[name="phone"]').val(response.data.phone);
				$('input[name="user_name"]').val(response.data.user_name);
				$('input[name="status_name"]').val(response.data.status_name);
				$('input[name="is_placing_items_name"]').val(response.data.is_placing_items_name);
				$('input[name="is_live_name"]').val(response.data.is_live_name);
				$('input[name="is_video_recording_name"]').val(response.data.is_video_recording_name);
				$('input[name="is_open_name"]').val(response.data.is_open_name);
				form.render();
			} else {
				layer.msg(response.message, { icon: 2, time: 2000 });
			}
		}).fail(function (error) {});

		//关闭当前页面
        $(".close").click(function () {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index);
        });
	})
</script>
</body>
</html>
